package com.jinlia.show.modules.base.model.po;


import com.jinlia.show.modules.base.wxapp.entity.ShoppingCart;
import lombok.Data;
import org.springframework.beans.BeanUtils;

@Data
public class ShoppingCartPO extends ShoppingCart {

    /**
     * 商品详情
     */
    private GoodsPO goodsPO;

    public static ShoppingCartPO fromEntity(ShoppingCart goods) {
        ShoppingCartPO goodsVO = new ShoppingCartPO();
        BeanUtils.copyProperties(goods, goodsVO);
        return goodsVO;
    }

    public static ShoppingCart toEntity(ShoppingCartPO vo) {
        ShoppingCart entity = new ShoppingCart();
        BeanUtils.copyProperties(vo, entity);
        return entity;
    }
}
